home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / System7 tools / Frontier / Frontier SDK 2.1 / Toolkits / Outline Sharing Toolkit / outlinesharing.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-11  |  5.2 KB  |  223 lines  |  [TEXT/KAHL]

  1.  
  2. /*© Copyright 1992 UserLand Software, Inc.  All Rights Reserved.*/
  3.  
  4. #define optoolkitinclude /*so other modules can tell that we've been included*/
  5.  
  6.  
  7. typedef enum opLineSpacing {
  8.     
  9.     opSinglespaced = 1,
  10.     
  11.     opOneandalittlespaced = 2,
  12.     
  13.     opOneandaquarterspaced = 3,
  14.     
  15.     opOneandahalfspaced = 4,
  16.     
  17.     opDoublespaced = 5,
  18.     
  19.     opTriplespaced = 6
  20.     } opLineSpacing;
  21.     
  22.  
  23. typedef enum opDirection { /*used to navigate and reorganize outlines*/
  24.  
  25.     opNoDirection = 0, 
  26.     
  27.     opUp = 1, 
  28.     
  29.     opDown = 2, 
  30.     
  31.     opLeft = 3,
  32.     
  33.     opRight = 4, 
  34.     
  35.     opFlatup = 5, 
  36.     
  37.     opFlatdown = 6
  38.     } opDirection;
  39.  
  40.  
  41. typedef struct tyheadrecord {
  42.  
  43.     StringHandle hstring; /*the text of the headline*/
  44.     
  45.     struct tyheadrecord **headlinkdown, **headlinkup, **headlinkleft, **headlinkright;
  46.     
  47.     short headlevel; /*summits are at level 0, their children at level 1*/
  48.     
  49.     Boolean flexpanded: 1; /*is this line expanded?*/
  50.     
  51.     Boolean fldirty: 1; /*is this line in need of display?*/
  52.     
  53.     Boolean flcomment: 1; /*is this line a comment?*/
  54.     
  55.     Boolean flbreakpoint; /*in a script, is a breakpoint set here?*/
  56.     
  57.     Boolean tmpbit: 1; /*use this for anything you like*/
  58.     
  59.     Handle headrecordrefcon; /*you can link anything you like into a headrecord*/
  60.     } tyheadrecord, *ptrheadrecord, **hdlheadrecord;
  61.  
  62.  
  63. typedef struct tyoutlinerecord {
  64.     
  65.     hdlheadrecord hsummit; /*the first summit of the structure*/
  66.     
  67.     hdlheadrecord hbarcursor; /*the line the bar cursor is on*/
  68.     
  69.     hdlheadrecord hline1; /*this node is displayed on the 0th line in the window*/
  70.     
  71.     short lnumbarcursor; /*line number that the bar cursor is on, may be off screen*/
  72.     
  73.     short ctexpanded; /*number of nodes expanded*/
  74.     
  75.     short fontnum, fontsize, fontstyle; /*the display fontsizestyle*/
  76.     
  77.     short lineindent; /*how many pixels to indent for each level*/
  78.     
  79.     opLineSpacing linespacing; /*indicates number of pixels to add to each line*/
  80.     
  81.     Rect outlinerect; /*the rectangle that the outline is displayed in*/
  82.     
  83.     Rect windowrect; /*the size and position of window that last displayed outline*/
  84.     
  85.     short vertmin, vertmax, vertcurrent; /*vertical scrollbar info*/
  86.     
  87.     short horizmin, horizmax, horizcurrent; /*horiz scrollbar info*/
  88.     
  89.     long timecreated, timelastsave; /*the time and date the outline was created/last saved*/
  90.     
  91.     long ctsaves; /*the number of times this outline has been saved*/
  92.     
  93.     long outlinerefcon; /*for use by application*/
  94.     } tyoutlinerecord, *ptroutlinerecord, **hdloutlinerecord;
  95.  
  96.  
  97. typedef Boolean (*opvisitcallback) (hdlheadrecord); /*callback for the visit routines*/
  98.  
  99.  
  100. extern hdloutlinerecord outlinedata; /*all OS Toolkit routines operate off this global*/
  101.  
  102.  
  103. /*function prototypes -- creating and disposing outline records*/
  104.  
  105.     pascal Boolean opNewOutlineRecord (hdloutlinerecord *);
  106.  
  107.     pascal void opDisposeOutlineRecord (hdloutlinerecord);
  108.     
  109.  
  110. /*setting the current outline*/
  111.  
  112.     pascal Boolean opSetTarget (hdloutlinerecord);
  113.     
  114.     pascal Boolean opPushOutline (hdloutlinerecord);
  115.     
  116.     pascal Boolean opPopOutline (void);
  117.  
  118.  
  119. /*sending and receiving outline structures thru Apple Events*/
  120.  
  121.     pascal Boolean IACgetoutlineparam (OSType, hdloutlinerecord *);
  122.  
  123.     pascal Boolean IACpushoutlineparam (hdloutlinerecord, OSType);
  124.  
  125.     pascal Boolean IACreturnoutline (hdloutlinerecord);
  126.     
  127.  
  128. /*packing/unpacking outlines into/from contiguous handles*/
  129.  
  130.     pascal Boolean opPack (Handle *);
  131.  
  132.     pascal Boolean opUnpack (Handle, long *);
  133.  
  134.  
  135. /*navigating thru an outline structure*/
  136.  
  137.     pascal Boolean opGo (hdlheadrecord *, opDirection);
  138.     
  139.     
  140. /*getting and setting headline strings*/
  141.     
  142.     pascal void opGetHeadString (hdlheadrecord, Str255);
  143.  
  144.     pascal Boolean opSetHeadString (hdlheadrecord, Str255);
  145.     
  146.     
  147. /*structure editing*/
  148.  
  149.     pascal Boolean opAddHeadline (hdlheadrecord, opDirection, Str255, hdlheadrecord *);
  150.  
  151.     pascal void opUnlink (hdlheadrecord);
  152.     
  153.     pascal void opDisposeStructure (hdlheadrecord);
  154.     
  155.     pascal Boolean opDeposit (hdlheadrecord, opDirection, hdlheadrecord);
  156.     
  157.     pascal Boolean opPromoteSubheads (hdlheadrecord);
  158.     
  159.  
  160. /*getting information about a headrecord*/
  161.  
  162.     pascal Boolean opIsFirstInList (hdlheadrecord);
  163.  
  164.     pascal Boolean opIsLastInList (hdlheadrecord);
  165.  
  166.     pascal Boolean opHasSubheads (hdlheadrecord);
  167.  
  168.     pascal Boolean opSubheadsExpanded (hdlheadrecord);
  169.     
  170.     pascal Boolean opIsSubordinateTo (hdlheadrecord, hdlheadrecord);
  171.  
  172.     pascal Boolean opIsNestedInComment (hdlheadrecord);
  173.  
  174.     pascal hdlheadrecord opGetAncestor (hdlheadrecord, short);
  175.  
  176.     pascal hdlheadrecord opGetLastSubhead (hdlheadrecord);
  177.  
  178.     pascal hdlheadrecord opGetNthSubhead (hdlheadrecord, short);
  179.  
  180.     pascal hdlheadrecord opGetNthSummit (short);
  181.  
  182.     pascal hdlheadrecord opGetLastExpanded (hdlheadrecord);
  183.  
  184.     pascal hdlheadrecord opGetFirstAtLevel (hdlheadrecord);
  185.     
  186.     pascal short opGetSiblingNumber (hdlheadrecord);
  187.     
  188.  
  189. /*counting things*/
  190.  
  191.     pascal short opCountAtLevel (hdlheadrecord);
  192.     
  193.     pascal short opCountSummits (void);
  194.  
  195.     pascal short opCountSubs (hdlheadrecord);
  196.  
  197.     pascal short opCountAllHeads (void);
  198.  
  199.  
  200. /*traversing the outline*/
  201.  
  202.     pascal Boolean opVisitOutline (opvisitcallback visit);
  203.     
  204.     pascal Boolean opRecursivelyVisit (hdlheadrecord, short, opvisitcallback);
  205.  
  206.     pascal Boolean opRecursivelyVisitKidsFirst (hdlheadrecord, short, opvisitcallback);
  207.  
  208.     pascal Boolean opSiblingVisiter (hdlheadrecord, Boolean, opvisitcallback);
  209.     
  210.     
  211. /*miscellaneous routines*/
  212.  
  213.     pascal void opResetLevels (hdlheadrecord);
  214.  
  215.     pascal short opSetCountExpanded (void);
  216.  
  217.     
  218.  
  219.  
  220.  
  221.  
  222.  
  223.